Repository navigation
KZN-19166 - support multiple sessions using different credentials - #39
Merged
keegandonley merged 3 commits intoOct 26, 2026
Merged
keegandonley merged 3 commits into
keegandonley merged 3 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Logout can be undone by a late refresh, and printed retry commands can lose the selected account.
2 open issues
What changed in this PR
Adds per-command account selection to the CLI so concurrent sessions can use different saved credentials without changing the current account.
Changes:
- Adds business/user flags and environment-variable selectors to account-aware commands.
- Keeps running commands and bound authentication helpers pinned to their selected account across account switches.
- Updates command help, documentation, and regression tests.
The .copilot-docs/ directory is absent, indicating the documentation setup workflow did not run; plugin-contract verification was unavailable.
| File | Description |
|---|---|
| src/program.test.ts | Verifies new flags and admin argument forwarding. |
| src/lib/pushHeadless.ts | Resolves named accounts for push and targets. |
| src/lib/pushHeadless.test.ts | Tests account selection and credential isolation. |
| src/lib/oauthSession.ts | Pins token reads to individual account files. |
| src/lib/oauthSession.test.ts | Tests pinning, refreshes, switches, and logout. |
| src/lib/oauthCommands.ts | Adds account-aware resolution and bound token access. |
| src/lib/oauthCommands.test.ts | Tests named accounts and authentication helpers. |
| src/lib/kizenAdmin.ts | Binds admin invocations to selected accounts. |
| src/lib/kizenAdmin.test.ts | Tests admin selectors and account binding. |
| src/lib/authSelection.ts | Defines selector precedence and validation. |
| src/lib/authSelection.test.ts | Tests flag and environment-variable precedence. |
| src/commands/block.ts | Exposes account selectors for block commands. |
| src/commands/auth.ts | Updates whoami options and auth-header help. |
| src/commands/admin.ts | Documents admin account-selection options. |
| README.md | Explains independent sessions and credential selection. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Adds support for using credentials in sessions explicitly, so that claude (for example) can have multiple sessions pointing at different accounts or environments.
Jira: https://kizen.atlassian.net/browse/KZN-19166